#pragma once
#include<vector>
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
namespace GIS20226
{
	void function(vector<int> a)
	{
		int size = a.size();
		vector<int> primenumber;
		vector<int> number;
		int numbersum = 0;
		for (int i = 0; i < size; i++)
		{
			if (judge(a[i]))
			{
				primenumber.push_back(a[i]);
				numbersum += a[i];
			}
			else
			{
				number.push_back(a[i]);
			}
		}
		for (int i = 0; i < primenumber.size(); i++)
		{
			number.push_back(primenumber[i]);
		}

		ofstream opf;
		opf.open("test.txt");
		for (int i = 0; i < number.size(); i++)
		{
			opf << to_string(number[i])<<" ";
		}
		opf.close();
	}

	bool judge(int number)
	{
		for (int i = 2; i < number; i++)
		{
			if (number % i == 0)
				return false;
		}
		return true;
	}
}